<script lang="ts">
    import { goto } from "$app/navigation";
    import { getTargetVideoDate } from "$lib/api/lzizy/interface";
import VideoList from "../../components/VideoList.svelte";
import { appState } from "../../stores/state.svelte";

async function VideoList_Item_Click(index: number) {
	// if(appState.playItem === null) {
		appState.playItem = await getTargetVideoDate(appState.searchList[index].id);
	// }
	await goto("/info");
}
</script>

<main>
	<VideoList data={appState.searchList} onClick={ VideoList_Item_Click }/>
</main>

<style lang="scss">
	main {
		height: 100%;
		overflow: hidden;
	}
</style>